class MessageDetailModel {
  List<MessageModel>? list; //所有专题
  bool? hasNext;

  MessageDetailModel({
    this.list,
    this.hasNext,
  });

  MessageDetailModel.fromJson(Map<String, dynamic>? json) {
    json ??= {};
    list = json["list"] == null ? null : List<MessageModel>.from(json["list"].map((x) => MessageModel.fromJson(x)));
    hasNext = json['hasNext'];
  }
}

class MessageModel {
  final String? content;
  final String? createdAt;
  final String? id;
  final bool? isRead;
  final String? msgType;
  final String? objCover;
  final String? objId;
  final String? objName;
  final String? sendAvatar;
  final String? sendName;
  final int? sendUid;
  final int? userCount;
  final List<UserGroup>? userGroup;
  final String? vipExpireDate;
  final int? vipLevel;

  MessageModel({
    this.content,
    this.createdAt,
    this.id,
    this.isRead,
    this.msgType,
    this.objCover,
    this.objId,
    this.objName,
    this.sendAvatar,
    this.sendName,
    this.sendUid,
    this.userCount,
    this.userGroup,
    this.vipExpireDate,
    this.vipLevel,
  });

  factory MessageModel.fromJson(Map<String, dynamic> json) => MessageModel(
        content: json["content"],
        createdAt: json["createdAt"],
        id: json["id"],
        isRead: json["isRead"],
        msgType: json["msgType"],
        objCover: json["objCover"],
        objId: json["objId"],
        objName: json["objName"],
        sendAvatar: json["sendAvatar"],
        sendName: json["sendName"],
        sendUid: json["sendUid"],
        userCount: json["userCount"],
        userGroup: json["userGroup"] == null ? [] : List<UserGroup>.from(json["userGroup"]!.map((x) => UserGroup.fromJson(x))),
        vipExpireDate: json["vipExpireDate"],
        vipLevel: json["vipLevel"],
      );

  Map<String, dynamic> toJson() => {
        "content": content,
        "createdAt": createdAt,
        "id": id,
        "isRead": isRead,
        "msgType": msgType,
        "objCover": objCover,
        "objId": objId,
        "objName": objName,
        "sendAvatar": sendAvatar,
        "sendName": sendName,
        "sendUid": sendUid,
        "userCount": userCount,
        "userGroup": userGroup == null ? [] : List<dynamic>.from(userGroup!.map((x) => x.toJson())),
        "vipExpireDate": vipExpireDate,
        "vipLevel": vipLevel,
      };
}

class UserGroup {
  final String? avatar;
  final String? name;
  final int? uid;

  UserGroup({
    this.avatar,
    this.name,
    this.uid,
  });

  factory UserGroup.fromJson(Map<String, dynamic> json) => UserGroup(
        avatar: json["avatar"],
        name: json["name"],
        uid: json["uid"],
      );

  Map<String, dynamic> toJson() => {
        "avatar": avatar,
        "name": name,
        "uid": uid,
      };
}
